<?php if(!IS_AJAX){?>

<include file="Public:header" />
<div class="row">
    <div class="col-sm-7 col-md-8 col-lg-9">
        <div class="panel">
            <div class="panel-heading"><span class="pagetitle">审批管理</span></div>
            <div class="panel-body">
                <div class="DataList CustomerList">
                    <?php }?>
                    <volist name="list" id="vo">
                        <div class="DataListItem DataListItembg item{$vo.id}" style="margin-top:4px; padding:0 5px;">
                            <div class="row">
                                <div class="col-sm-6 col-xs-12">
                                    <div class="widget-content padded">
                                        <h4 style="margin:0; font-size:16px; font-weight:bold; padding:5px 0;">{$vo.title}</h4>
                                        <p>编号：{$vo.record}</p>
                                        <p>审请人：{$vo.proposername}</p>
                                        <p>审批人：{$vo.approvername}</p>
                                        <p>提交时间：{:date('Y-m-d H:i:s', $vo['createtime'])}</p>
                                        <p>状态：
                                            <eq name="vo['state']" value="0">
                                                <span class="label label-danger">驳回</span>
                                            </eq>
                                            <eq name="vo['state']" value="1">
                                                <span class="label label-warning">未审批</span>
                                            </eq>
                                            <eq name="vo['state']" value="2">
                                                <span class="label label-info">审批中</span>
                                            </eq>
                                            <eq name="vo['state']" value="3">
                                                <span class="label label-success">通过</span>
                                            </eq>
                                            <eq name="vo['state']" value="-1">
                                                <span class="">未递交</span>
                                            </eq>
                                        </p>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-xs-12 hidden-xs" style="text-align:right;">
                                    <div class="optionBtnBox">
                                        <a class="button" href="#window" onClick="_openWindow('{:U('mymissionread', array('id' => $vo['id']))}', 500, '{$vo.title}(修改)', '确认', null, '');"><i class="fa icon-edit"></i> 修改</a>
                                        &nbsp;
                                        <eq name="vo['state']" value="-1">
                                            <a class="button" href="javascript:void(0);" onClick="mission_send({$vo.id}, this);"><i class="fa icon-mail-forward"></i> 递交</a>
                                        </eq>
                                        <a class="button" href="javascript:void(0);" title="发送给其他人" onClick="_openWindow('{:U('Mission/sendTo', array('id' => $vo['id']))}', 500, '{$vo.title}(发送表格)', '发送', null, '');"><i class="fa icon-exchange"></i> 发送</a>
                                        &nbsp;
                                        <if condition="in_array($vo['state'], array(0,1,2))">
                                            <a class="button" href="javascript:void(0);" onClick="mission_cancel({$vo.id}, this);"><i class="fa icon-download-alt"></i> 取消</a>
                                        </if>
                                    </div>
                                </div>
                            </div>
                            <div class="BottomOptionBtn hidden">
                                <a class="button" href="javascript:void(0);" onClick="_openWindow('{:U('mymissionread', array('id' => $vo['id']))}', 500, '{$vo.title}(修改)', '确认', null, '');"><i class="icon-edit"></i> 修改</a>
                                <eq name="vo['state']" value="-1">
                                    <a class="button" href="javascript:void(0);" onClick="mission_send({$vo.id}, this);"><i class="fa icon-mail-forward"></i> 递交</a>
                                </eq>
                                <a class="button" href="javascript:void(0);" title="发送给其他人" onClick="_openWindow('{:U('sendTo', array('id' => $vo['id']))}', 500, '{$vo.title}(发送表格)', '发送', null, '');"><i class="icon-exchange"></i> 发送</a>
                                <if condition="in_array($vo['state'], array(0,1,2))">
                                    <a class="button" href="javascript:void(0);" onClick="mission_cancel({$vo.id}, this);"><i class="fa icon-download-alt"></i> 取消</a>
                                </if>
                            </div>
                        </div>
                    </volist>
                    <?php if(!IS_AJAX){?>
                </div>
                <div class="loading hidden">正在加载</div>
                <div class="PagesBox"><?php echo $pages;?></div>
            </div>
        </div>
    </div>
    <div class="col-sm-5 col-md-4 col-lg-3">
        <div class="panel">
            <header class="panel-heading"> 审批筛选 </header>
            <div class="panel-body">

                <a style="margin-top:10px" class="btn btn-info listajaxrequest on" href="javascript:void(0);" rel="<?php echo U('');?>">全部</a> <volist name='candy' id='candy'>&nbsp;<a class="btn btn-info listajaxrequest" href="javascript:void(0);" style="margin-top:10px" rel="{:U('',array('id'=>$candy['id']))}">{$candy.name}({$candy.count})</a></volist>


                <form role="form" method="post" action="{:U('Mission/mymission')}" class="checkoutform">
                
                
                <input type="hidden" name="state" value="all">
                            <input type="hidden" name="type" value="1">
                    <div class="form-group opacity">
                        <div class="panel">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <a class="accordion-toggle collapsed" data-parent="#accordion" data-toggle="collapse" href="#faq1" style="font-size:14px">
                                        <div class="caret pull-right"></div>
                                        表单审批状态</a>
                                </div>
                            </div>
                            <div class="panel-collapse collapse" id="faq1">
                                <div class="panel-body icheck" style="font-size: 14px;">





                                    <div class="radio square-red single-row"><input value="99" name="status" type="radio" nullmsg="输入不能为空" datatype="*" errormsg="不支持特殊字符" checked="checked"><label>全部</label></div>
                                    <div class="radio square-red single-row"><input value="0" name="status" type="radio" nullmsg="输入不能为空" datatype="*" errormsg="不支持特殊字符" <eq name="status" value="0">checked="checked"</eq>><label>驳回</label></div>
                                    <div class="radio square-red single-row"><input value="1" name="status" type="radio" nullmsg="输入不能为空" datatype="*" errormsg="不支持特殊字符" <eq name="status" value="1">checked="checked"</eq>><label>待审核</label></div>
                                    <div class="radio square-red single-row"><input value="2" name="status" type="radio" nullmsg="输入不能为空" datatype="*" errormsg="不支持特殊字符" <eq name="status" value="2">checked="checked"</eq>><label>审核中</label></div>
                                    <div class="radio square-red single-row"><input value="3" name="status" type="radio" nullmsg="输入不能为空" datatype="*" errormsg="不支持特殊字符" <eq name="status" value="3">checked="checked"</eq>><label>已通过</label></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr>
                    <div class="form-group">
                        <label for="email">搜索关键词</label>
                        <input class="form-control" id="keywords" name="keywords" value="{$keywords}" placeholder="审批名称或姓名" type="text">
                    </div>
                    <hr>
                    <div class="form-group">
                        <div class="row">
                            <div class="col-sm-12 col-xs-12" style="margin:0;padding:0"><input class="form-control" id="starttime" name="starttime" readonly onClick="WdatePicker();" style="cursor:pointer;" value="{$starttime}" placeholder="起始时间" type="text"></div>
                        </div>
                        <div class="row">
                            <div class="col-sm-12 col-xs-12" style="margin:0;padding:0"><input class="form-control" id="endtime" name="endtime" onClick="WdatePicker();" readonly style="cursor:pointer;" value="{$endtime}" placeholder="结束时间" type="text"></div>
                        </div>
                    </div>
                    <hr>
                    <div class="form-group">
                        <div class="col-md-12"  style="margin:0;padding:0">
                            <select class="form-control" name="pagesize" style="display:inline;width:50%;margin-right:15px;">
                                <option value="10" <eq name="pagesize" value="10">selected="selected"</eq>>每页10条</option>
                                <option value="25" <eq name="pagesize" value="25">selected="selected"</eq>>每页25条</option>
                                <option value="50" <eq name="pagesize" value="50">selected="selected"</eq>>每页50条</option>
                                <option value="100" <eq name="pagesize" value="100">selected="selected"</eq>>每页100条</option>
                            </select>
                            <button class="btn btn-sm btn-info pull-right" style="margin:0;padding:5px 15px;border-radius:0">点击搜索</button>
                        </div>
                    </div>
                </form>





            </div>
        </div>



    </div>
</div>
<include file="Public:script" />
<script>
    $.cookie('loadIndexUrl', window.location.href, {path:'/'});
    $(".checkoutform:eq(0)").Validform({
        ajaxPost:true,
        tiptype:function(data,s){
            if(s.type == 1){
                //$.ThinkBox.success(data,{'delayClose':0, 'close': '关闭'});
            }
        },
        datatype:{
            "text":function(gets,obj,curform,regxp){
                return true;
            },"image":function(gets,obj,curform,regxp){
                return true;
            }
        },
        callback:function(data){
            //检测登录
            $('.ThinkBox-close').trigger('click');
            if(data.status == 0){
                //$.ThinkBox.error(data.info,{'delayClose':200});
                //$.ThinkBox('hide');

                //$.ThinkBox.error(data.info,{'delayClose':200});
            }else{
                //alert(data.info);
                //alert(id);

                //更新列表
                updateList();

            }
        }
    });

    function mission_send(id,e){
        if(!confirm('确定递交吗？')){
            return false;
        }
        hideLayer();
        $.post('{:U('send')}', {id:id}, function(data){
            if(data.status == 1){
                updateList();
            }else{
                alert(data.info);
            }
        }, 'json');
    }



    function mission_cancel(id,e){
        if(!confirm('确定取消吗？')){
            return false;
        }
        hideLayer();
        $.post('{:U('cancel')}', {id:id}, function(data){
            if(data.status == 1){
                updateList();
            }else{
                alert(data.info);
            }
        }, 'json');
    }


</script>
</body></html><?php }?>